
<div id="header" class="add">
	<!--网站头部导航条-->
	<div id="headerTop">
		<div class="container">
			<ul id="headerTop-left">
				<li><a href="#">华为官网</a></li>
				<li><a href="#">荣耀官网</a></li>
				<li class="headerTop-left-li"><a href="#">软件应用</a>
					<div class="headerTop-left-div">
						<ul>
							<li><a href="#">EMUI</a></li>
							<li><a href="#">应用市场</a></li>
							<li><a href="#">云服务</a></li>
							<li><a href="#">开发者联盟</a></li>
						</ul>
					</div>
					
				</li>
				<li><a href="#">花粉俱乐部</a></li>
				<li><a href="#">Select Region</a></li>
			</ul>
			<ul id="headerTop-right">
				<li><a href="#">网站导航</a></li>
				<li><a href="#">手机版</a></li>
				<li><a href="#">V码(优购码)</a></li>
				<li><a href="shoping/dingdan.php">我的订单</a></li>
				<?php //判断session是否有值从而判断用户是否登录，如果登录则屏蔽登录注册按钮
					session_start();
					if(!empty($_SESSION['adminuser'])){
						echo "<li><a href='../admin/useraction.php?a=logout&b=indexID' target=\"_top\">退出</a></li>";
						//判断是不是管理员,如果是管理员则跳到管理员中心
						if($_SESSION[adminuser][state]!=0){
							echo '<li><a href="userAdmin/index.php">';
						}else{
							echo '<li><a href="../admin/index.php">';
						}	
						echo "您好：".(($_SESSION[adminuser][name]!="")?$_SESSION[adminuser][name]:$_SESSION[adminuser][username])."</a></li>";		//判断用户有无输入用户名，没有则显示用户的账号名
					}else{
						echo "<li><a href='../web/reg/reg.php'>注册</a></li>";
						echo "<li><a href='../web/reg/login.php'>登录</a></li>";
					}
				?>
				
			</ul>
		</div>
	</div>
	<!--网站Logo行开始-->
	<div id="header-main" class="container">
		<!--logo-->
		<div id="logo">
			<a href="index.php"><img src="./img/newLogo.png"></a>
		</div>
		<!--搜索栏-->
		<div id="search">
			<form action="./list.php" method="get">
				<input type="text" id="search-text" name="search">
				<input type="submit" id="search-sub" value="搜索">
			<form>
		</div>
		<!--购物车-->
		<div id="shopping">
			<div id="myCart">
				<a href="shoping/buycar.php">我的购物车</a>
			</div>
		</div>
		<!--二维码旁边的小点-->
		<ul>
			<li></li>
			<li></li>
		</ul>
		<!--二维码图片-->
		<div id="code">
			<img src="./img/qrcode_vmall_app01.png" title="专享周三无线专场">
		</div>
	   </div>
	</div>
	<!--导航栏开始-->
	<div id="nav" class="add">
		<div id="nav_con" class="container">
			<div id="nav_left">
				<span>全部商品</span>
			</div>
			<div id="nav_right">
				<?php
					include("../public/config.php");
					$link = mysqli_connect(HOST,USER,PASS,DBNAME) or die("数据库连接失败！");
					mysqli_set_charset($link,"utf8");
					$sql = "select * from type";
					$result = mysqli_query($link,$sql);
					echo '<a href="index.php">首页</a>';
					for ($i=1; $i < 4; $i++) { 
						$row = mysqli_fetch_assoc($result);
						echo '<a href="list.php?tid='.$row['id'].'">'.$row['name'].'</a>';
					}

				?>
			</div>
		</div>
	</div>